package com.liruo.learn.spring.mvc.controller.mvc.modelattribute;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author:liruo
 * @Date:2023-10-05-18:09:57
 * @Desc
 */
@Controller
public class Controller1 {
  @ModelAttribute("a")
  public String a(){
    return "aVal";
  }
  @ResponseBody
  @GetMapping("/ma")
  public String useA(@ModelAttribute("a")String a, Model model){
    return a + " " + model;
  }
}
